PowerTCP Emulation for .NET CF
Write(Byte[],Int32,Int32) Method
See Also  Example Send comments on this topic.
Dart.Emulation Namespace > Vt Class > Write Method : Write(Byte[],Int32,Int32) Method




data
The data to display.
offset
The location in the array to start writing from.
count
The count of bytes to display.
Displays data contained within a byte array in the Vt window and interprets all escape sequences.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub Write( _
   ByVal data() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As Vt
Dim data() As Byte
Dim offset As Integer
Dim count As Integer
 
instance.Write(data, offset, count)
C# 
public void Write( 
   byte[] data,
   int offset,
   int count
)
Managed Extensions for C++ 
public: void Write( 
   byte[]* data,
   int offset,
   int count
) 
C++/CLI 
public:
void Write( 
   array<byte>^ data,
   int offset,
   int count
) 

Parameters

data
The data to display.
offset
The location in the array to start writing from.
count
The count of bytes to display.

Example

The following example demonstrates how to get information about a cell in the display.
C#Copy Code
private void writeToDisplay(System.IO.MemoryStream stream)
{
    //Read data into a byte array
    stream.Position = 0;
    byte[] data = new byte[stream.Length];
    stream.Read(data, 0, (int)stream.Length);

    //Write a byte array
    vt1.Write(data);

    //Write a byte array with offset and count
    vt1.Write(data, 0, data.Length);

    //Write a string
    vt1.Write(System.Text.Encoding.Default.GetString(data, 0, data.Length));
}
Visual BasicCopy Code
Private Sub writeToDisplay(ByVal stream As System.IO.MemoryStream)
	'Read data into a byte array
	stream.Position = 0
	Dim data() As Byte = New Byte(stream.Length - 1){}
	stream.Read(data, 0, CInt(Fix(stream.Length)))

	'Write a byte array
	vt1.Write(data)

	'Write a byte array with offset and count
	vt1.Write(data, 0, data.Length)

	'Write a string
	vt1.Write(System.Text.Encoding.Default.GetString(data, 0, data.Length))
End Sub

Remarks

Use this method to process data received from a host, or VT formatted data from a file or other data source. The control interprets and displays the data using the terminal type specified in the TerminalType property.

When Encoding is set to a value other than Encoding.ASCII (default), the byte array is interpreted as multibyte characters.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 4.2
© 2010 Dart Communications. All Rights Reserved.